from enum import Enum


def _average_speed(duration, n=1, clock_direction=True):
    w = 360.0 * n / duration
    direction = 1 if clock_direction else -1
    return lambda t: direction * w * t if t <= duration else 0


class RotateFunctions(Enum):
    average = _average_speed
